﻿using System;


public class SSCAnalyticsAdapter
{
	private static string _methodStartSession = "startSession";
	private static string _methodStartAllSession = "startAllSessions";
	private static string _methodEndSession = "endSession";
	private static string _methodSendEvent = "sendEvent";
	private static string _methodSendScreen = "sendScreenEvent";
	private static string _methodSetDebugMode = "setDebugMode";
	private static string _methodGetDebugMode = "getDebugMode";
	private static string _methodSetGameObjName = "setGameObjName";

	private static SSCAnalyticsAdapter _instance;
	private string _gameObjName;


	private SSCAnalyticsAdapter ()
	{

	}

	public static SSCAnalyticsAdapter getInstance ()
	{
		if (_instance == null)
			_instance = new SSCAnalyticsAdapter ();
		return _instance;
	}


	public void startSession (int type)
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodStartSession, type);
	}

	public void startAllSession ()
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodStartAllSession);
	}

	public void endSession ()
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodEndSession);
	}

	public void sendEvent (string action, string label)
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodSendEvent, action,label);

	}


	public void sendEvent (string category, string action, string label, long value)
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodSendEvent, category,action,label,value);

	}

	public void sendScreen (string screenName)
	{
		AndroidHelper.getAnalyticsManagerAndroidObject().Call (_methodSendScreen, screenName);
	}

	public void setDebugMode (bool debug)
	{
		AndroidHelper.getAnalyticsManagerAndroidObject ().Call (_methodSetDebugMode,debug);
	}

	public bool getDebugMode ()
	{
		return AndroidHelper.getAnalyticsManagerAndroidObject ().Call<bool> (_methodGetDebugMode);
	}

	public void setGameObjName(string name){
		AndroidHelper.getAnalyticsManagerAndroidObject().Call(_methodSetGameObjName,name);
	}

}


